Create Database sitesunnytech;

Use sitesunnytech;


Create table tbl_Account 
	(
		Account_ID					int auto_increment primary key,
		Account_User				nvarchar(100) unique NOT NULL, 
		Account_Password			varchar(100) NOT NULL, 
		Account_Email				varchar(200) unique NOT NULL,
		Account_FullName			nvarchar(100) NOT NULL,
		Account_Phonenumber			varchar(15),
		Account_Address				nvarchar(200),	
		Account_Avatar				varchar(300),
		Account_Role				varchar(10),
		Account_qlsanpham			int,
		Account_qldanhmuc			int,
		Account_qlhoadon			int,
		Account_qlkhachhang			int,
		Account_qlthongtin			int,
		Account_qlgiaodien			int
		
		
	);
Insert into tbl_Account  values(1,N'admin',N'7c4a8d09ca3762af61e59520943dc26494f8941b','dangtruongson91@gmail.com',N'Đặng Trường Sơn','0974114460',N'Hà Nội','','Admin',1,1,1,1,1,1);
Create table tbl_IDBox
(
 IDBox_ID	int auto_increment primary key,
 IDBox_Active int
 
);
drop table idbox ;
select * from tbl_Idbox;
 insert into tbl_ThietKeWebsite (Category_ID1,Category_ID2,Category_ID3,ThietKeWebsite_Name,ThietKeWebsite_Image,ThietKeWebsite_Title,ThietKeWebsite_Summary,ThietKeWebsite_Description,ThietKeWebsite_Date) values (1,9,9,N'dfhdf',N'/Resources/Images/Image-Products/1a.png',N'dfhdfh',N'<p>
	fdhdfh</p>
',N'<p>
	dfhdfh</p>
','3/31/2013 4:39:41 PM');
insert into tbl_IDBox (IDBox_Active) values (1);

CREATE TABLE tbl_ThongKe
(
	ThongKe_ID int auto_increment primary key,
	ThongKe_Time datetime NOT NULL,
	ThongKe_Count bigint NOT NULL
);

Create table tbl_BoxCategory
(
		BoxCategory_ID				int  primary key,
		Category_ID1                 int 
);

insert into tbl_BoxCategory (BoxCategory_ID,Category_ID1 ) values (1,2);


Create table tbl_Category
	(
		Category_ID1				int auto_increment primary key,
		Category_ID2				int,
		Category_Name				nvarchar(500),
		Category_Image				nvarchar(500),
		Category_Summary			nvarchar(500),
		Category_Description		nvarchar(10000),
		Category_ActiveTop			int,
		Category_ActiveLeft			int,
		Category_Link				nvarchar(500)
	)ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_unicode_ci;


Insert into tbl_Category (Category_ID2,Category_Name,Category_Image,Category_Summary,Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values( 0, N'Thiết kế website',N'Resources/Icons/col-img1.png',N'menu cap 1',N'menu cap 1',1,1,N'ThietKeWebsite.aspx');
Insert into tbl_Category (Category_ID2,Category_Name,Category_Image,Category_Summary,Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values( 0, N'Thiết kế đồ họa',N'Resources/Icons/col-img2.png',N'menu cap 1',N'menu cap 1',1,1,N'ThietKeDoHoa.aspx');
Insert into tbl_Category (Category_ID2,Category_Name,Category_Image,Category_Summary,Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values( 0, N'Dịch vụ',N'Resources/Icons/col-img3.png',N'menu cap 1',N'menu cap 1',1,1,N'DichVu.aspx');
Insert into tbl_Category (Category_ID2,Category_Name,Category_Image,Category_Summary,Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values( 0, N'Tên miền & Hosting',N'Resources/Icons/col-img4.png',N'menu cap 1',N'menu cap 1',1,1,N'TenMienHosting.aspx');
Insert into tbl_Category (Category_ID2,Category_Name,Category_Image,Category_Summary,Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values( 0, N'Tin tức - Sự kiện',N'Resources/Icons/col-img2.png',N'menu cap 1',N'menu cap 1',1,1,N'ListNews.aspx');

Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (1,N'Thiết kế web cơ bản',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeWebsite.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (1,N'Thiết kế web doanh nghiệp',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeWebsite.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (1,N'Thiết kế web bán hàng',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeWebsite.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (1,N'Thiết kế web TMĐT',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeWebsite.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (1,N'Quản trị web',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeWebsite.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (1,N'Cắt HTML/CSS',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeWebsite.aspx');

Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (2,N'Bộ nhận diện thương hiệu',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeDoHoa.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (2,N'Thiết kế Logo',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeDoHoa.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (2,N'Thiết kế Banner',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeDoHoa.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (2,N'Thiết kế giao diện website',N'',N'menu cap 1',N'menu cap 2',1,1,N'ThietKeDoHoa.aspx');

Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (3,N'Quảng cáo Google Adwords',N'',N'menu cap 1',N'menu cap 2',1,1,N'DichVu.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (3,N'Dịch vụ SEO Top 10',N'',N'menu cap 1',N'menu cap 2',1,1,N'DichVu.aspx');

Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (4,N'Bảng giá tên miền Quốc tế',N'',N'menu cap 1',N'menu cap 2',1,1,N'TenMienHosting.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (4,N'Bảng giá tên miền Việt nam',N'',N'menu cap 1',N'menu cap 2',1,1,N'TenMienHosting.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (4,N'Bảng giá web hosting',N'',N'menu cap 1',N'menu cap 2',1,1,N'TenMienHosting.aspx');
Insert into tbl_Category (Category_ID2, Category_Name, Category_Image,Category_Summary, Category_Description,Category_ActiveTop,Category_ActiveLeft,Category_Link) values (4,N'Bảng giá Supper Hosting',N'',N'menu cap 1',N'menu cap 2',1,1,N'TenMienHosting.aspx');





Create table tbl_ThietKeWebsite
	(
		ThietKeWebsite_ID					int auto_increment primary key,	
		Category_ID1			int,	
		Category_ID2			int,
		Category_ID3			int,	
		ThietKeWebsite_Name					text,
		ThietKeWebsite_Image				text,
		ThietKeWebsite_Title				text,
		ThietKeWebsite_Summary				text ,
		ThietKeWebsite_Description			text ,
		ThietKeWebsite_Date					datetime
	);	

Insert into tbl_ThietKeWebsite (Category_ID1,Category_ID2,Category_ID3,ThietKeWebsite_Name,ThietKeWebsite_Image,ThietKeWebsite_Title,ThietKeWebsite_Summary,ThietKeWebsite_Description,ThietKeWebsite_date) 
values	(
			1,
			5,5,
			N'Tin Tức 1',
			N'Resources/Images/video-img.png',
			N'Thiết kế website đẹp',
			N'Tóm tắt 1',
			N'Resources/Images/video-img.png',
			N'2013-01-03 09:09:09'
		);


Create table tbl_Logo
	(
		Logo_ID						int auto_increment primary key,
		Logo_Image					text,
		Logo_Link					text,
		Logo_Date					datetime
	);

Insert into tbl_Logo (Logo_Image,Logo_Link,Logo_Date) values(N'Resources/Icons/sunnytech.png', N'http://sunnytech.vn', N'2013-01-03 09:09:09');

Create table tbl_Slider
	(
		Slider_ID 					int auto_increment primary key,
		Slider_Alt 					text ,
		Slider_Place 				text ,
		Slider_Image 				text ,
		Slider_Link 				text ,
		Slider_Title 				text ,
		Slider_Detail				text ,
		Slider_Click				text ,
		Slider_Size 				text ,
		Slider_Date 				datetime 
	);

Insert into tbl_Slider (Slider_Alt, Slider_Place, Slider_Image, Slider_Link, Slider_Title, Slider_Detail, Slider_Click, Slider_Size, Slider_Date) values (N'Thiet Ke Website Re', N'Trang chu', N'Resources/Images/slide-img1.png', N'http://sunnytech.vn', N'Thiết Kế Website Rẻ', N'Cong Ty Co Phan Cong Nghe Va Truyen Thong Sunny Tech Viet Nam thiet ke website re nhat Viet Nam', N'Click Here', N'200x200', N'2013-01-03 09:09:09');
Insert into tbl_Slider (Slider_Alt, Slider_Place, Slider_Image, Slider_Link, Slider_Title, Slider_Detail, Slider_Click, Slider_Size, Slider_Date) values (N'Thiet Ke Website Dep', N'Trang chu', N'Resources/Images/slide-img2.png', N'http://sunnytech.vn', N'Thiết Kế Website Đẹp', N'Cong Ty Co Phan Cong Nghe Va Truyen Thong Sunny Tech Viet Nam thiet ke website re nhat Viet Nam', N'Click Here', N'200x200', N'2013-01-03 09:09:09');
Insert into tbl_Slider (Slider_Alt, Slider_Place, Slider_Image, Slider_Link, Slider_Title, Slider_Detail, Slider_Click, Slider_Size, Slider_Date) values (N'Thiet Ke Website Nhanh', N'Trang chu', N'Resources/Images/slide-img1.png', N'http://sunnytech.vn', N'Thiết Kế Website Nhanh', N'Cong Ty Co Phan Cong Nghe Va Truyen Thong Sunny Tech Viet Nam thiet ke website re nhat Viet Nam', N'Click Here', N'200x200', N'2013-01-03 09:09:09');
Insert into tbl_Slider (Slider_Alt, Slider_Place, Slider_Image, Slider_Link, Slider_Title, Slider_Detail, Slider_Click, Slider_Size, Slider_Date) values (N'Thiet Ke Website Top', N'Trang chu', N'Resources/Images/slide-img2.png', N'http://sunnytech.vn', N'Thiết Kế Website Top', N'Cong Ty Co Phan Cong Nghe Va Truyen Thong Sunny Tech Viet Nam thiet ke website re nhat Viet Nam', N'Click Here', N'200x200', N'2013-01-03 09:09:09');
Insert into tbl_Slider (Slider_Alt, Slider_Place, Slider_Image, Slider_Link, Slider_Title, Slider_Detail, Slider_Click, Slider_Size, Slider_Date) values (N'Thiet Ke Website Ao', N'Trang chu', N'Resources/Images/slide-img1.png', N'http://sunnytech.vn', N'Thiết Kế Website Áo', N'Cong Ty Co Phan Cong Nghe Va Truyen Thong Sunny Tech Viet Nam thiet ke website re nhat Viet Nam', N'Click Here', N'200x200', N'2013-01-03 09:09:09');

Create table tbl_Poster 
	(
		Poster_ID					int auto_increment primary key,
		Poster_Name					text,
		Poster_Place				text,
		Poster_Image				text,
		Poster_Link					text,
		Poster_Title				text,
		Poster_Size					text,
		Poster_date					datetime
	);

Create table tbl_News
	(
		News_ID						int auto_increment primary key,
		News_Name					text,
		News_Summary				text,
		News_Image					text,
		News_Description			text,
		News_Date					datetime
	);

Insert into tbl_News (News_Name,News_Summary,News_Image,News_Description,News_Date) 
values(
		N'Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech',
		N'Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech 
		  Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech 
          Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech 
          Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech 
          Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech',
		N'Resources/Images/video-img.png',
		N'Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech 
		  Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech 
          Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech 
          Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech 
          Tin tuyen dung thang 4: Nhan vien kinh doanh thuong mai dien tu sunny tech',
		N'2013-01-03 09:09:09'
);

Create table tbl_CompanyInfo
	(
		CompanyInfo_ID				int auto_increment primary key,
		CompanyInfo_Name			text,
		CompanyInfo_Add 			text,
		CompanyInfo_Mobile			text,
		CompanyInfo_Fax				text,
		CompanyInfo_Email			text

	);

Insert into tbl_CompanyInfo (CompanyInfo_Name,CompanyInfo_Add,CompanyInfo_Mobile,CompanyInfo_Fax,CompanyInfo_Email)
values (
		N'Cty CP Công nghệ và Truyền thông Sunny Tech Việt Nam',
		N'Tầng 7 - Tòa nhà số 5 - Ngõ Trại Cá - P.Trương Định - Q.Hai Bà Trưng - Hà Nội',
		N'0977.952.335 - (04)3 744 36 36',
		N'(04)3 744 26 26',
		N'info@sunnytech.vn'
		);

Create table tbl_HelpOnline
	(
		HelpOnline_ID				int auto_increment primary key,
		HelpOnline_Name				nvarchar(200),
		HelpOnline_Image			nvarchar(200),
		HelpOnline_Yahoo			nvarchar(200),
		HelpOnline_Sky				nvarchar(200),
		HelpOnline_Phone			char (50)
	);	

SELECT COLUMN_NAME  FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tbl_category' ;


Insert into tbl_HelpOnline (HelpOnline_Name,HelpOnline_Image,HelpOnline_Yahoo,HelpOnline_Phone) values(N'Hoang Van Thai', N'Resources/Images/Image.jpg', N'thaihv.sunnytech', N'0977 952 335');
Insert into tbl_HelpOnline (HelpOnline_Name,HelpOnline_Image,HelpOnline_Yahoo,HelpOnline_Phone) values(N'Nguyen Viet Hai', N'Resources/Images/avatar-doraemon.jpg', N'hainv.sunnytech', N'0983 386 310');
Insert into tbl_HelpOnline (HelpOnline_Name,HelpOnline_Image,HelpOnline_Yahoo,HelpOnline_Phone) values(N'Dang Truong Son', N'Resources/Images/Image.jpg', N'sondt.sunnytech', N'01649 649 070');
Insert into tbl_HelpOnline (HelpOnline_Name,HelpOnline_Image,HelpOnline_Yahoo,HelpOnline_Phone) values(N'Nguyen Tuan Linh', N'Resources/Images/avatar-doraemon.jpg', N'linhnt.sunnytech', N'0975 796 307');

Create table tbl_Contact
	(
		Contact_ID					int auto_increment primary key,
		Contact_Email				nvarchar(100),
		Contact_Details				text
	);
Create table tbl_Note
	(
		Note_ID			int auto_increment primary key,
		Note_Date		Datetime,
		Note_Content			text
		
	);	

Create table tbl_DanhNgon
	(
		DanhNgon_ID					int auto_increment primary key,
		DanhNgon_Details			text,
		DanhNgon_Author				text
	);

Insert into tbl_DanhNgon (DanhNgon_Details,DanhNgon_Author) values(N'Hay nhin the gioi xung quanh de thay rang ban van con hanh phuc so voi nhung dau kho ma nguoi khac dang phai ganh chiu',N'Suu tam');
Insert into tbl_DanhNgon (DanhNgon_Details,DanhNgon_Author) values(N'Trong cuoc song, noi nao co mot nguoi chien thang, noi do co mot nguoi thua cuoc. Nhung nguoi biet hi sinh vi nguoi khac luon la nguoi chien thang',N'Suu tam');
Insert into tbl_DanhNgon (DanhNgon_Details,DanhNgon_Author) values(N'Cho du hoan canh hien tai co toi te the nao di nua, se ko co thoi diem nao cho su bat dau tot hon la ngay tu bay gio',N'Suu tam');
Insert into tbl_DanhNgon (DanhNgon_Details,DanhNgon_Author) values(N'Tien khong phai la tat ca, nhung tien giup chung ta lam tat ca',N'Suu tam');
Insert into tbl_DanhNgon (DanhNgon_Details,DanhNgon_Author) values(N'Khong quan trong la tien ma quan trong la bao nhieu tien',N'Suu tam');

DELIMITER //
CREATE PROCEDURE CallSQL(IN param1 VARCHAR(1000))
    BEGIN
	   SET @myquery = param1;
	   PREPARE stmt1 FROM @myquery;
       EXECUTE stmt1;
    END //
 DELIMITER ;
